<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Path3DSymbolLayer</title>

<link rel="stylesheet" href="https://jsdev.arcgis.com/4.0beta3/esri/css/main.css">
<script src="https://jsdev.arcgis.com/4.0beta3/"></script>

<style>
html,
body {
  padding: 0;
  margin: 0;
}
</style>

<script>
require([
    "esri/Map",
    "esri/views/SceneView",
    "esri/layers/FeatureLayer",
    "esri/geometry/SpatialReference",
    "esri/geometry/Point",
    "esri/geometry/Extent",
    "esri/Camera",
    "esri/PopupTemplate",
    "esri/renderers/SimpleRenderer",
    "esri/symbols/PathSymbol3DLayer",
    "esri/symbols/LineSymbol3D",
    "dojo/domReady!"
  ],
  function(
    Map, SceneView, FeatureLayer, SpatialReference, Point, Extent, Camera, PopupTemplate, SimpleRenderer, PathSymbol3DLayer, LineSymbol3D
  ) {
    
    var initCam = new Camera({
      position: new Point({
        x: -9163836,
        y: -39892,
        z: 5061677,
        spatialReference: new SpatialReference({ wkid: 3857 })
      }),
      heading: 16.25,
      tilt: 28.15
    });
    
    var renderer = new SimpleRenderer({
      symbol: new LineSymbol3D({
        symbolLayers: [new PathSymbol3DLayer()]
      }),
      visualVariables: [
        {
          type: "sizeInfo",
          field: "WIND_KTS",
          minDataValue: 10,
          maxDataValue: 160,
          minSize: 10000,
          maxSize: 160000,
          valueUnit: "unknown"
        }, {
          type: "colorInfo",
          field: "PRESSURE",
          theme: "high-to-low",
          stops: [
            { value: 900, color: "red" },
            { value: 950, color: "yellow"},  
            { value: 1000, color: "green"}
          ]
        }
      ]
    });
    
//    , {
//          type: "opacityInfo",
//          field: "ATE_COL_DOM_PER",
//          stops: [
//            { value: 55, opacity: 0.1 },
//            { value: 75, opacity: 1 }    
//          ]
//        }
    

    /*****************************************************************
     * Create an ArcGISDynamicLayer instance pointing to a Map Service
     * containing data about pool permits in Southern California.
     *****************************************************************/
     permitsLyr = new FeatureLayer({
      url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/1",
      renderer: renderer,
      popupTemplate: new PopupTemplate({
        content: "{*}"
      })
    });

    /*****************************************************************
     * Add the layer to a map
     *****************************************************************/
     map = new Map({
      basemap: "gray"
     });

    map.add([permitsLyr]);

     view = new SceneView({
      container: "viewDiv",
      map: map,
//      center: [-73.3, 28],
//      zoom: 5
      camera: initCam
    });
  });
</script>
</head>

<body>
  <div id="viewDiv"></div>
</body>

</html>